package com.lenovo.order_service.utils;

import com.lenovo.order_service.enums.ResultCode;

public class BaseResponseUtil {
    public BaseResponseUtil() {
    }

    public static <T> BaseResponse<T> getBaseResponse(T data) {
        return getErrorBaseResponse(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getName(), data);
    }

    public static <T> BaseResponse<T> getErrorBaseResponse(int resCode, String message, T data) {
        BaseResponse<T> baseResponse = new BaseResponse();
        baseResponse.setResCode(resCode);
        baseResponse.setMessage(message);
        baseResponse.setData(data);
        return baseResponse;
    }
}
